package com.molichuxing.services.property;

/**
 * 订阅商品规格（1：driving_time_length）
 * @author xuelin yi
 */
public enum GoodsSpecEnum {

  DRIVING_TIME_LENGTH(1, "driving_time_length"),IS_BUY_BACK(2, "is_buy_back"),PAYMENT_CYCLE(3, "payment_cycle");

  int value;
  String name;

  GoodsSpecEnum(int value, String name) {
    this.value = value;
    this.name = name;
  }

  public int getValue() {
    return value;
  }

  public String getName() {
    return name;
  }

  /**
   * 通过value获取枚举的name
   * @param value
   * @return
   */
  public static String getName(int value) {
    for (GoodsSpecEnum orderSource : GoodsSpecEnum.values()) {
      if (orderSource.getValue() == value) {
        return orderSource.name;
      }
    }
    return null;
  }
}
